// 导入密码加密包
const bcrypt = require('bcryptjs')

// 明文密码转hash
exports.passToHash = (pass) => {
  return bcrypt.hashSync(pass)
}

// 验证明文密码与hash是否匹配
exports.validatePass = (pass, hash) => {
  return bcrypt.compareSync(pass, hash)
}
